import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/pages/home/index/Index'
import GIndex from '@/pages/garden/index'
import Login from '@/pages/login/Login'
import NavList from './navList'
import GNavList from './gNavList'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: {
        name: 'Index'
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/index',
      name: 'Index',
      meta: {
        requireAuth: true,
        level: 'home'
      },
      component: Index,
      redirect: {
        name: 'HealthyToday'
      },
      children: NavList
    },
    {
      path: '/garden',
      name: 'GIndex',
      meta: {
        requireAuth: true,
        level: 'garden'
      },
      component: GIndex,
      redirect: {
        name: 'GHealthyToday'
      },
      children: GNavList
    }
  ]
})
